import java.io.*;
public class Main {
	public static void main(String[] args) {
		String s="";
		int sum=0;
		int a=0;
		String b1[]=null;
		String b2[]=null;
		FileInputStream fis=null;
		try {
				fis=new FileInputStream("D:\\list.txt");
				byte b[]=new byte[100000000];	
				while((a = fis.read(b))!=-1)
					{
						s=new String(b,0,a);
					    System.out.print(s);
					}
				b1=s.split("\n");
				for(int i=0;i<b1.length;i++)
					{
						b2=b1[i].split(" ");
						sum=sum+b2.length;
					}
					System.out.println(sum);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		catch (IOException e) {
			e.printStackTrace();
	    }	
	}
}